package com.dzsw.thread;

import java.util.concurrent.*;

/**
 * @author sunz
 * @version 1.0
 * @CreateTime 2021-04-20-15:32
 */
public class CallableMain {

    private static ExecutorService executorService = new ThreadPoolExecutor(4, 10,
            60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>());

    public static void main(String[] args) throws Exception {
        Future<String> f = executorService.submit(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return "ok";
            }
        });
        String result = f.get();
        System.out.println(result);
    }
}
